package com.xy.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xy.bean.User;
import com.xy.service.UserService;

@Controller
public class UserController {

	@Resource
	private UserService userService;
	
	@RequestMapping("toLogin.do")
	public String toLogin() {
		return "login";
	}
	
	@RequestMapping("toRegister.do")
	public String toRegister() {
		return "register";
	}
	
	@RequestMapping("getCountByName.do")
	@ResponseBody
	public int getCountByName(User user) {
	  return userService.getCountByName(user);
		
	}
	
}
